﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MC.RideEvent.Mvc.Models.Repository;
using MC.RideEvent.Mvc.Models.ViewModel;

namespace MC.RideEvent.Mvc.Controllers
{
    public class HomeController : Controller
    {
        private IEventRepository _eventRepo;
        private IWayRepository _wayRepo;

        public HomeController(IEventRepository eventRepo)
        {
            _eventRepo = eventRepo;
        }

        public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";

            var listEvent = _eventRepo.GetLastEvents();
            //var listWays = _wayRepo.GetWays();

            HomeViewModel modelview = new HomeViewModel();
            modelview.ListEvents = listEvent;
            //modelview.ListWays = listWays;

            return View("Index", modelview);
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
